<script type="text/javascript" src="/media/js/jquery.validate.min.js"></script>

<script type="text/javascript">
    $(document).ready(function() {
      
        $("#area_form").validate({
            rules: {
                name: "required",
                name_en: "required",
                name_url: "required"
                
            },
            messages: {
                name: "请输入名称!",
                name_en: "请输入英文名称!",
                name_url: "请输入显示地址!"
                
                
			
            }
        });
      
    });
</script>

<style type="text/css">



    #area_form .inner-form dt {

        text-align: right;
    }



</style>


<div class="box box-100">
    <div class="boxin">
        <div class="header">
            <h3>添加地区</h3>
            <a class="button" href="/admin/area/list">地区列表&nbsp;»</a>
        </div>
        <form id="area_form" class="basic" action="/admin/area/do_edit/<?php echo $data['id_area']?>" method="post" enctype="multipart/form-data"><!-- Default basic forms -->
            <div class="inner-form">
                <!-- error and information messages -->
                <?php echo Message::get(); ?>
                <dl>
                    <dt><label for="name" class="req">地区：</label></dt>
                    <dd style="width:15%;float:left">
                    <input class="txt " type="text" id="name" name="name" value="<?php echo $data['name']?>"/><!-- class error for wrong filled inputs -->
                    <dt style="width:10%;float:left"><label for="name_en" class="req">英文名：</label></dt>
                    <dd style="width:10%;float:left"><input class="txt " type="text" id="name_en" name="name_en" value="<?php echo $data['name_en']?>"/></dd>
                        <dt style="width:10%;float:left"><label for="position">排序：</label></dt>
                    <dd style="width:10%;float:left"><input class="txt " type="text" id="position" name="position" value="<?php echo $data['position']?>"/></dd>
                    <div style="clear:both;"></div>
                    </dd>
                    
                          <dt class="ttop"><label for="name_url" class="req">地址栏显示：</label></dt><!-- .ttop for vertical-align: top -->
                    <dd>
                    
                     <input class="txt" type="text" id="name_url" name="name_url" size="30" value="<?php echo $data['name_url']?>"/>
                    
                    </dd>

                    <dt><label for="id_parent" >上级分类：</label></dt>
                    <dd>
                        <select id="id_parent" name="id_parent">
                                <option value="0">根地区</option>
                            <?php if (is_array($area_parent)): ?>
                                <?php foreach ($area_parent as $key => $value): ?>
                                   <?php if($key != $data['id_area']):?>
                                    <option value="<?php echo $key ?>" <?php if($key == $data['id_parent']){?>selected<?php }?>><?php echo $value['pre'].$value['name'] ?></option>
                                <?php endif ?>
                                <?php endforeach ?>
                            <?php endif ?>

                        </select>
                    </dd>
                    
                     <dt><label for="id_pack" >打包：</label></dt>
                    <dd>
                        <select id="id_pack" name="id_pack">
                             <option value="0">不打包</option>
                            <?php if (is_array($area_parent)): ?>
                                <?php foreach ($area_parent as $key => $value): ?>
                             <?php if($key != $data['id_area']):?>
                                    <option value="<?php echo $key ?>" <?php if($key == $data['id_pack']){?>selected<?php }?>><?php echo $value['pre'].$value['name'] ?></option>
                                <?php endif ?>
                                        <?php endforeach ?>
                            <?php endif ?>

                        </select>
                    </dd>
                    
                          <dt class="ttop"><label for="meta_url">转向链接：</label></dt><!-- .ttop for vertical-align: top -->
                    <dd>
                    
                     <input class="txt" type="text" id="meta_url" name="meta_url" size="30" value="<?php echo $data['meta_url']?>"/>
                    
                    </dd>
                    
                          <dt class="ttop"><label for="mapcode">地图代码：</label></dt><!-- .ttop for vertical-align: top -->
                    <dd>
                    
                     <input class="txt" type="text" id="mapcode" name="mapcode" size="30" value="<?php echo $data['mapcode']?>"/>
                    
                    </dd>
                

         
                    <dt class="ttop"><label for="meta_title">metatitle：</label></dt><!-- .ttop for vertical-align: top -->
                    <dd>
                    
                     <input class="txt" type="text" id="meta_title" name="meta_title" size="30" value="<?php echo $data['meta_title']?>"/>
                    
                    </dd>
                    
                    
                        <dt class="ttop"><label for="meta_keywords">meta_keywords：</label></dt><!-- .ttop for vertical-align: top -->
                    <dd><textarea name="meta_keywords" id="meta_description" cols="10" rows="5"><?php echo $data['meta_description']?></textarea></dd>

                    
                    
                    <dt class="ttop"><label for="meta_description">metadescription：</label></dt><!-- .ttop for vertical-align: top -->
                    <dd><textarea name="meta_description" id="meta_description" cols="10" rows="5"><?php echo $data['meta_description']?></textarea></dd>
                    


                    <dt><label for="images" >上传图片:</label></dt>
                    <dd>
                        <input class="file" type="file" id="images" name="images" />
                       <!-- OR <img src="css/img/upload.gif" alt="" /> --><!-- uploading animation -->
                    </dd>

                    <dt></dt>
                    <dd style="text-align:center">
                        <input class="button" type="submit" value="确认添加" style=" text-align: center;"/>
                    </dd>
                </dl>
            </div>
        </form>
    </div>
</div>